﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<math.h>
int main()
{
    int i = 0;
    int sum = 0;
    int mid = 0;
    int x = 0;
    int y = 0;
    int z = 0;
    for (i = 654; i < 10000; i++)
    {
        mid = i;
        sum = z = x = 0;
        while (mid)
        {
            
            x += (mid % 10)*pow(10,z);
            y = mid / 10;
            mid /= 10;
            sum += x * y;
            z++;
        }
        if (sum == i)
        {
            printf("%d ", sum);
        }
    }
    return 0;
}
